<?php
/*
	我的足迹
*/
defined('BY_JYA') or exit('error');
$return['ischecklogin']=$this->model('member')->checklogin('','','','',true);
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['list']=array();
	set_html('title','获奖记录');
	exi($return);
}
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_weishop_game_getlog',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	foreach($return['list'] as &$v){
			$v['createtime']=date('Y-m-d H:i:s',$v['createtime']);
			$v['reward']=json_decode($v['reward'],true);
			$v['typetitle']=$this->prizeType[$v['reward']['type']];
			$v['fee']=$v['fee']>0?$v['fee']:$v['reward']['jifen'];
			if($v['reward']['type']==1){
				$v['fee']=$v['reward']['title'];
			}
			$game=pdo_get('jy_weishop_game',array('id'=>$v['game_id'],'uniacid'=>$_SESSION['uniacid']),array('ismerch','merchid'));
			if($game['ismerch'] || $game['merchid']){
				$v['createorder']='jy_merch/order.create//gamelogid=';
			}else{
				$v['createorder']='jy_weishop/order.create//gamelogid=';
			}
	}
	exi($return);
}
